package com.easondongh.system.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author EasonDongH
 * @date 2020/4/28 16:07
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName(value = "sys_user")
public class SysUser implements Serializable {

    @TableField(exist = false)
    private String keyCode;

    @TableField(exist = false)
    private String captcha;

    /**
     * 主键
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 姓名
     */
    @TableField(value = "name")
    private String name;

    /**
     * 登陆名
     */
    @TableField(value = "login_name")
    private String loginName;

    /**
     * 地址
     */
    @TableField(value = "address")
    private String address;

    /**
     * 性别
     */
    @TableField(value = "sex")
    private Integer sex;

    /**
     * 备注
     */
    @TableField(value = "remark")
    private String remark;

    /**
     * 密码
     */
    @TableField(value = "password")
    private String password;

    @JsonIgnore
    public String getPassword() {
        return password;
    }

    @JsonProperty
    public void setPassword(String password) {
        this.password = password;
    }

    /**
     * 部门ID
     */
    @TableField(value = "dept_id")
    private Integer deptId;

    @TableField(exist = false)
    private String deptName;

    /**
     * 入职时间
     */
    @TableField(value = "hire_date")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone="GMT+8")
    private Date hireDate;

    @TableField(value = "order_num")
    private Integer orderNum;

    /**
     * 用户类型[0超级管理员1普通用户]
     */
    @TableField(value = "type")
    private Integer type;

    /**
     * 头像地址
     */
    @TableField(value = "img_path")
    private String imgPath;

    /**
     * 盐
     */
    @TableField(value = "salt")
    @JsonIgnore
    private String salt;

    /**
     *  是否可用
     */
    @TableField(value = "enable")
    private Integer enable;

    private static final long serialVersionUID = 1L;

    public static final String COL_ID = "id";

    public static final String COL_NAME = "name";

    public static final String COL_LOGIN_NAME = "login_name";

    public static final String COL_ADDRESS = "address";

    public static final String COL_SEX = "sex";

    public static final String COL_REMARK = "remark";

    public static final String COL_PWD = "pwd";

    public static final String COL_DEPT_ID = "dept_id";

    public static final String COL_HIRE_DATE = "hire_date";

    public static final String COL_ORDER_NUM = "order_num";

    public static final String COL_TYPE = "type";

    public static final String COL_IMG_PATH = "img_path";

    public static final String COL_SALT = "salt";

    public static final String COL_ENABLE = "enable";
}